//
//  HWVoiceRoomModel.swift
//  PlayWithProject
//
//  Created by 王昌健 on 2021/8/16.
//

import UIKit
import HandyJSON
enum HWVoiceRoomMsgType:Int {
    //接收
    case receive = 0
    //发送
    case send
    //进房
    case userEnterRoom
    case userLeaveRoom
}
enum HWVoiceUserType:NSInteger {
    case audience = 0//观众
    case anchor //主持人
    case skiller//技师
    case owner //房主
    case boss //老板
    
}
enum HWVoiceSeateStatus:NSInteger {
    case unUse = 0
    case onUse
    case close
}
class HWVoiceRoomModel: NSObject {
    /// 房间号
    var roomID:String!
    /// 房主ID
    var ownerID:String!
    var ownerName:String!
    /// 房间名字
    var roomName:String!
    /// 房间封面
    var roomFace:String!
    var seatCount:NSInteger!
    /// 群公告
    var introduction:String!
    /// 数字房间号
    var roomNumId:String!
    var roomBg:String = ""
    init(roomID:String,roomName:String,ownerID:String,roomFace:String) {
        super.init()
        
        self.roomID = roomID
        self.ownerID = ownerID
        self.roomName = roomName
        self.roomFace = roomFace
    }

}
class HWVoiceRoomUserInfo: NSObject {
    
    var userId:String!
    var userName:String!
    var userFace:String!
    
    var msgType:HWVoiceRoomMsgType!
    
    var userType:HWVoiceUserType!
    /// 消息
    var text:String!
    /// 座位信息
    var seatIndex:NSInteger!
    /// 上麦申请的ID
    var inviteID:String!
    
    var isMute:Bool!
    
}

class HWVoiceRoomSeatInfo:NSObject {
    /// 静音
    var mute:Bool = false
    /// userId
    var user:String = ""
    
    var status:NSInteger = 0
}

class HWVoiceRoomSeatModel: NSObject {
    var seatIndex: Int = -1
    var isClosed: Bool = false
    var isUsed: Bool = false
    var isOwner: Bool = false
    var isHost: Bool = false
    var isBose:Bool = false
    var seatInfo: HWVoiceRoomSeatInfo?
    var seatUser: HWVoiceRoomUserInfo?
    var action: ((Int) -> Void)? // 入参为SeatIndex
    var isTalking: Bool = false
    var selected:Bool = false
}

class HWVoiceRoomGiftListModel: HandyJSON {
    required init() {}
    ///类型 普通 豪华 背包
    var title:String!
    ///类型ID
    var type:NSInteger!
    ///礼物列表
    var list:[[HWVoiceRoomGiftModel]]!
}
class HWVoiceRoomGiftModel: HandyJSON {
    required init() {}
    /// 礼物ID
    var id:String!
    /// 名称
    var name:String!
    /// 价格
    var money:String!
    /// 图标
    var icon:String!
    /// 动图类型 0没有 1 gif 2 SVGA
    var img_type:NSInteger!
    /// 动图地址
    var img:String!
    var status:NSInteger!
    /// 动画时长（秒）
    var time:String!
    /// 我的背包中礼物剩余数量，其他位置忽略该参数
    var num:String!
    /// 选中状态
    var selected:Bool = false
    
}

class HWVoiceRoomInfoModel:HandyJSON {
    required init() {}
    /// 直播间ID
    var id:String!
    /// 房间ID
    var room_id:String!
    /// 房名
    var name:String!
    /// base64 需要解析一下
    var description:String!
    /// 图标
    var icon:String!
    /// 背景图片
    var bgimg:String!
    /// 当前人数
    var num:String!
    /// 热度
    var hot:String!
    /// 创建人ID
    var supadmin_uid:String!
    /// 房管ID
    var admin_uid:String!
    /// 聊天时状态 0 关闭中 1开启中
    var status:String!
    var is_guanzhu:Int!
    var type:String!
    var passwd:String!
    var type_id:String!
    /// 拉流地址
    var play_url:String!
    var ownerId:String!
    var pet_name = ""
    var face = ""
    var live_uid = ""
    var game:HWVoiceRoomGameModel!
}

class HWVoiceRoomGameModel:HandyJSON {
    required init () {}
    var icon = ""
    var id = ""
    var name = ""
    var point = ""
    var tuijianzhishu = 0.0
    var type = ""
}
